import { BaseResponse, BasePageResp } from "@/api/baseType";

export interface SpuData {
  id?: number;
  spuName: string;
  description: string;
  category3Id: number | undefined;
  tmId: number | undefined;
  spuSaleAttrList: SpuSaleAttr[];
  spuImageList: SpuImage[];
}
export interface SpuSaleAttr {
  id?: number;
  baseSaleAttrId: number;
  saleAttrName: string;
  spuId: number | undefined;
  flag?: boolean;
  saleAttrVal?: string;
  saleAttrAndValue?: string;
  spuSaleAttrValueList: SpuSaleAttrValue[];
}
export interface SpuSaleAttrValue {
  baseSaleAttrId: number | undefined;
  id?: number;
  saleAttrName: string;
  saleAttrValueName: string | undefined;
  spuId: number | undefined;
}

export interface SpuImage {
  id?: number;
  imgName?: string;
  name?: string;
  url?: string;
  imgUrl?: string;
  isDefault?: string;
  spuId?: number;
}

interface SpuDataListResp extends BasePageResp {
  records: SpuData[];
}

export interface baseSaleAttr {
  id?: number;
  name: string;
}
export interface baseSaleAttrListResp extends BaseResponse {
  data: baseSaleAttr[];
}

export interface SpuDataPageQueryResp extends BaseResponse {
  data: SpuDataListResp;
}
export interface SpuDataPageQueryReq {
  category3Id?: number;
}
export interface SpuImageListResp extends BaseResponse {
  data: SpuImage[];
}
export interface singleSpuResp extends BasePageResp {
  data: SpuData;
}
export interface spuSaleAttrListResp extends BaseResponse {
  data: SpuSaleAttr[];
}
